; Music of Asphalt (1987) (Ubi Soft) (Philippe Marchiset)
; Ripped by Megachur the 13/11/2006

; Need System Vectors

	write "ASPHALT.BIN"

music_date_rip	equ &0db6
music_adr	equ &8f6b
first_theme	equ 0
last_theme	equ 0	; 0 -> 0

	read "music_header_v1_0.asm"

;
.init_music
;
	ld hl,l92f0
	ld a,#01
	call #bcbc
	ld hl,l92f4
	ld a,#02
	call #bcbc
	ld hl,l92f0
	ld a,#03
	call #bcbc
	ld hl,l92fb
	ld a,#01
	call #bcbf
	ld hl,l9308
	ld a,#02
	call #bcbf
	ld hl,l96f1
	ld de,l8f9f
	ld bc,#81ff
	jp #bcd7
;
.play_music
.l8f9f
;
	push ix
	push iy
	push af
	push bc
	push hl
	push de
	ld a,#02
	call #bcad
	and #0f
	cp #02
	jr c,l8fb5
	call l8fbe
.l8fb5
	pop de
	pop hl
	pop bc
	pop af
	pop iy
	pop ix
	ret
.l8fbe
	ld a,(l92ef)
	cp #1d
	jr nz,l8fc9
	xor a
	ld (l92ef),a
.l8fc9
	sla a
	ld e,a
	ld d,#00
	ld hl,l930c
	add hl,de
	ld e,(hl)
	inc hl
	ld d,(hl)
	push de
	ret
	ld a,(l92ee)
	push af
	ld hl,l9346
	call l9205
	call l91ff
	call l91f9
.l8fe7
	pop af
	inc a
	cp #18
	jr z,l8ff1
	ld (l92ee),a
	ret
.l8ff1
	xor a
	ld (l92ee),a
	ld a,(l92ef)
	inc a
	ld (l92ef),a
	ret
	ld a,(l92ee)
	push af
	ld hl,l93a6
	call l922d
	pop af
	push af
	ld hl,l9346
	call l9205
	call l91f9
	jr l8fe7
	ld a,(l92ee)
	push af
	ld hl,l9346
	call l9205
	call l9244
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l93be
	ld de,l941e
	call l9261
.l9034
	jr l8fe7
	ld a,(l92ee)
	push af
	ld hl,l9346
	call l9205
	call l9244
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l93d6
	ld de,l9436
	call l9261
	jr l8fe7
	ld a,(l92ee)
	push af
	ld hl,l9346
	call l9205
	call l9244
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l93ee
	ld de,l944e
	call l9261
.l9078
	jr l9034
	ld a,(l92ee)
	push af
	ld hl,l9346
	call l9205
	call l9244
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l9406
	ld de,l9466
	call l9261
	jr l9078
	ld a,(l92ee)
	push af
	ld hl,l9376
	call l9205
	call l9277
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l947e
	ld de,l94de
	call l9261
	jr l9078
	ld a,(l92ee)
	push af
	ld hl,l9376
	call l9205
	call l9244
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l9496
	ld de,l94f6
	call l9261
.l90de
	jr l9078
	ld a,(l92ee)
	push af
	ld hl,l9376
	call l9205
	call l9244
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l94ae
	ld de,l950e
	call l9261
	jr l90de
	ld a,(l92ee)
	push af
	ld hl,l9346
	call l9205
	call l9244
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l94c6
	ld de,l9526
	call l9261
	jr l90de
	ld a,(l92ee)
	push af
	ld hl,l953e
	call l927d
	call l9244
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	cp #0c
	jr c,l9147
	ld hl,l9346
	call l9205
	jr l90de
.l9147
	ld hl,l9376
	call l9205
.l914d
	jr l90de
	ld a,(l92ee)
	push af
	ld hl,l9376
	call l9205
	call l9277
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l9556
	ld de,l9586
	call l9261
	jr l914d
	ld a,(l92ee)
	push af
	ld hl,l9376
	call l9205
	call l9277
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l956e
	ld de,l959e
	call l9261
	jr l914d
	ld a,(l92ee)
	push af
	ld hl,l9376
	call l9205
	call l9277
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l95b6
	ld de,l95e6
	call l9261
.l91b3
	jr l914d
	ld a,(l92ee)
	push af
	ld hl,l9376
	call l9205
	call l9277
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l95b6
	ld de,l95e6
	call l9261
	jr l91b3
	ld a,(l92ee)
	push af
	ld hl,l9376
	call l9205
	call l9277
	pop af
	push af
	ld hl,l93a6
	call l924a
	pop af
	push af
	ld hl,l95ce
	ld de,l95fe
	call l9261
	jr l91b3
.l91f9
	ld hl,l928b
	jp #bcaa
.l91ff
	ld hl,l9294
	jp #bcaa
.l9205
	push af
	sla a
	ld e,a
	ld d,#00
	add hl,de
	ld e,(hl)
	inc hl
	ld d,(hl)
	ld (l92a0),de
	pop af
	cp #09
	jr nz,l921b
	xor a
	jr l9224
.l921b
	cp #15
	jr nz,l9222
	xor a
	jr l9224
.l9222
	ld a,#01
.l9224
	ld (l929e),a
	ld hl,l929d
	jp #bcaa
.l922d
	ld e,a
	ld d,#00
	add hl,de
	ld a,(hl)
	or a
	jr nz,l923b
	ld hl,l92a6
	jp #bcaa
.l923b
	ld (l92b4),a
	ld hl,l92af
	jp #bcaa
.l9244
	ld hl,l92b8
	jp #bcaa
.l924a
	ld e,a
	ld d,#00
	add hl,de
	ld a,(hl)
	or a
	jr nz,l9258
	ld hl,l92c1
	jp #bcaa
.l9258
	ld (l92cf),a
	ld hl,l92ca
	jp #bcaa
.l9261
	push de
	ld e,a
	ld d,#00
	add hl,de
	ld a,(hl)
	ld (l92d6),a
	pop hl
	add hl,de
	ld a,(hl)
	dec a
	ld (l92d9),a
	ld hl,l92d3
	jp #bcaa
.l9277
	ld hl,l92dc
	jp #bcaa
.l927d
	ld e,a
	ld d,#00
	add hl,de
	ld a,(hl)
	ld (l92e8),a
	ld hl,l92e5
	jp #bcaa
.l928b
	db #01,#00,#00,#00,#00,#00,#00,#0d
	db #00
.l9294
	db #02,#00,#00,#00,#00,#00,#00,#0d
	db #00
.l929d
	db #04
.l929e
	db #00,#01
.l92a0
	db #00,#00,#00,#0f,#0d,#00
.l92a6
	db #02,#01,#02,#ef,#00,#00,#0f,#0d
	db #00
.l92af
	db #02,#01,#00,#01,#00
.l92b4
	db #00,#0f,#0d,#00
.l92b8
	db #02,#00,#01,#d5,#00,#00,#0e,#05
	db #00
.l92c1
	db #02,#01,#02,#ef,#00,#00,#0f,#08
	db #00
.l92ca
	db #02
	db #01,#00,#01,#00
.l92cf
	db #00,#0f,#08,#00
.l92d3
	db #01,#00,#01
.l92d6
	db #00,#00,#00
.l92d9
	db #00,#0d
	db #00
.l92dc
	db #02,#00,#01,#b3,#00,#00,#0e,#05
	db #00
.l92e5
	db #01,#02,#01
.l92e8
	db #00,#00,#00,#0e,#0d,#00
.l92ee
	db #00
.l92ef
	db #03
.l92f0
	db #01,#0f,#ff,#02
.l92f4
	db #02,#07,#00,#01,#07,#ff,#02
.l92fb
	db #04,#03,#ff,#01,#03,#01,#01,#03
	db #ff,#01,#03,#01,#01
.l9308
	db #01,#08,#0f,#01
.l930c
	db #d7,#8f,#d7,#8f,#d7,#8f,#d7,#8f
	db #fd,#8f,#14,#90,#36,#90,#58,#90
	db #7a,#90,#9c,#90,#be,#90,#e0,#90
	db #02,#91,#24,#91,#24,#91,#4f,#91
	db #71,#91,#4f,#91,#71,#91,#93,#91
	db #b5,#91,#4f,#91,#d7,#91,#24,#91
	db #24,#91,#14,#90,#36,#90,#58,#90
	db #7a,#90
.l9346
	db #53,#03,#53,#03,#53,#03,#53,#03
	db #53,#03,#53,#03,#53,#03,#53,#03
	db #53,#03,#70,#04,#70,#04,#bc,#03
	db #53,#03,#53,#03,#53,#03,#53,#03
	db #53,#03,#53,#03,#53,#03,#53,#03
	db #cc,#02,#f6,#02,#f6,#02,#bc,#03
.l9376
	db #cc,#02,#cc,#02,#cc,#02,#cc,#02
	db #cc,#02,#cc,#02,#cc,#02,#cc,#02
	db #cc,#02,#bc,#03,#bc,#03,#24,#03
	db #cc,#02,#cc,#02,#cc,#02,#cc,#02
	db #cc,#02,#cc,#02,#cc,#02,#cc,#02
	db #5a,#02,#7e,#02,#7e,#02,#53,#03
.l93a6
	db #19,#01,#01,#00,#01,#00,#00,#01
	db #01,#00,#01,#0f,#1e,#01,#01,#00
	db #01,#00,#00,#01,#00,#00,#00,#00
.l93be
	db #6a,#6a,#6a,#71,#71,#71,#77,#77
	db #77,#8e,#8e,#8e,#77,#77,#77,#6a
	db #6a,#8e,#8e,#8e,#8e,#8e,#8e,#8e
.l93d6
	db #86,#86,#86,#86,#86,#77,#6a,#6a
	db #6a,#86,#86,#86,#8e,#8e,#8e,#b3
	db #8e,#b3,#d5,#d5,#d5,#d5,#d5,#d5
.l93ee
	db #6a,#6a,#6a,#71,#71,#71,#77,#77
	db #77,#8e,#8e,#8e,#77,#77,#77,#6a
	db #6a,#8e,#8e,#8e,#8e,#8e,#8e,#8e
.l9406
	db #86,#77,#86,#8e,#86,#8e,#9f,#8e
	db #9f,#6a,#6a,#6a,#6a,#6a,#6a,#6a
	db #6a,#6a,#8e,#8e,#77,#8e,#8e,#6a
.l941e
	db #0f,#0e,#0d,#0f,#0e,#0d,#0f,#0e
	db #0d,#0f,#0e,#0d,#0f,#0e,#0d,#0f
	db #0d,#0f,#0e,#0e,#0d,#0d,#0d,#0f
.l9436
	db #0d,#0f,#0d,#0f,#0f,#0f,#0e,#0d
	db #0f,#0e,#0d,#0f,#0e,#0d,#0f,#0f
	db #0f,#0f,#0e,#0e,#0d,#0d,#0c,#0c
.l944e
	db #0f,#0e,#0d,#0f,#0e,#0d,#0f,#0e
	db #0d,#0f,#0e,#0d,#0f,#0e,#0d,#0f
	db #0f,#0e,#0e,#0d,#0d,#0d,#0c,#0c
.l9466
	db #0f,#0f,#0f,#0f,#0f,#0f,#0f,#0f
	db #0f,#0f,#0f,#0e,#0e,#0e,#0d,#0d
	db #0c,#0c,#0f,#0d,#0f,#0f,#0d,#0f
.l947e
	db #77,#77,#77,#77,#77,#96,#b3,#b3
	db #b3,#b3,#b3,#9f,#96,#96,#9f,#b3
	db #b3,#e1,#ef,#ef,#ef,#ef,#ef,#ef
.l9496
	db #b3,#b3,#b3,#b3,#b3,#9f,#96,#96
	db #96,#96,#96,#86,#77,#77,#64,#6a
	db #6a,#86,#77,#77,#77,#77,#77,#77
.l94ae
	db #77,#77,#77,#77,#77,#96,#b3,#b3
	db #b3,#b3,#b3,#9f,#96,#96,#9f,#b3
	db #b3,#e1,#ef,#ef,#ef,#ef,#ef,#ef
.l94c6
	db #e1,#e1,#c9,#b3,#b3,#96,#9f,#9f
	db #9f,#d5,#d5,#d5,#b3,#be,#b3,#be
	db #b3,#be,#b3,#be,#b3,#be,#b3,#be
.l94de
	db #0f,#0e,#0d,#0d,#0c,#0f,#0f,#0e
	db #0d,#0d,#0c,#0f,#0f,#0d,#0f,#0f
	db #0d,#0f,#0f,#0e,#0e,#0d,#0d,#0c
.l94f6
	db #0f,#0e,#0d,#0d,#0c,#0f,#0f,#0e
	db #0d,#0d,#0c,#0f,#0f,#0d,#0f,#0f
	db #0d,#0f,#0f,#0f,#0e,#0d,#0d,#0c
.l950e
	db #0f,#0e,#0d,#0d,#0c,#0f,#0f,#0e
	db #0d,#0d,#0c,#0f,#0f,#0d,#0f,#0f
	db #0d,#0f,#0f,#0f,#0e,#0e,#0d,#0f
.l9526
	db #0f,#0f,#0f,#0f,#0d,#0f,#0f,#0e
	db #0d,#0f,#0e,#0d,#0f,#0f,#0e,#0e
	db #0d,#0d,#0d,#0d,#0c,#0c,#0c,#0c
.l953e
	db #8e,#b3,#d5,#8e,#b3,#d5,#8e,#b3
	db #d5,#8e,#b3,#d5,#77,#8e,#b3,#77
	db #8e,#b3,#77,#8e,#b3,#77,#8e,#b3
.l9556
	db #77,#77,#77,#77,#77,#6a,#64,#64
	db #64,#64,#64,#59,#64,#64,#64,#6a
	db #6a,#6a,#77,#7f,#77,#7f,#77,#7f
.l956e
	db #77,#77,#77,#77,#77,#6a,#64,#64
	db #64,#64,#64,#59,#50,#50,#50,#64
	db #64,#64,#59,#59,#59,#59,#59,#59
.l9586
	db #0f,#0e,#0d,#0d,#0c,#0f,#0f,#0e
	db #0d,#0d,#0c,#0f,#0f,#0e,#0d,#0f
	db #0e,#0d,#0f,#0f,#0f,#0f,#0f,#0f
.l959e
	db #0f,#0e,#0d,#0d,#0c,#0f,#0f,#0e
	db #0d,#0d,#0c,#0f,#0f,#0e,#0d,#0f
	db #0e,#0d,#0f,#0e,#0e,#0d,#0d,#0c
.l95b6
	db #96,#9f,#b3,#96,#9f,#b3,#9f,#9f
	db #96,#ef,#ef,#ef,#96,#9f,#b3,#96
	db #9f,#b3,#9f,#9f,#d5,#b3,#b3,#b3
.l95ce
	db #96,#96,#96,#9f,#9f,#9f,#b3,#b3
	db #b3,#d5,#d5,#d5,#b3,#be,#b3,#be
	db #b3,#be,#b3,#be,#b3,#be,#b3,#be
.l95e6
	db #0f,#0f,#0f,#0f,#0f,#0f,#0f,#0d
	db #0f,#0f,#0e,#0d,#0f,#0f,#0f,#0f
	db #0f,#0f,#0f,#0d,#0f,#0f,#0e,#0d
.l95fe
	db #0f,#0e,#0d,#0f,#0e,#0d,#0f,#0e
	db #0d,#0f,#0e,#0d,#0f,#0f,#0e,#0e
	db #0e,#0e,#0d,#0d,#0d,#0d,#0c,#0c


.l96f1
	db #00,#00,#00,#00,#00,#00,#00,#00
	db #00,#00,#00,#00,#00,#00,#00



;org #8109
;call #8f6b	; init ?


;org #96b7
;call #bcc8	; stop music
;
.game_name
	db "Asphalt",0
.game_year
	db "1987",0
.game_publisher
	db "Ubi Soft",0
.music_author
	db "Philippe Marchiset",0
.music_comment
	db "",0

	read "music_end_v1_0.asm"
